<include file="public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>

<div class="wrapper">
    <include file="public/breadcrumb"/>
    <section class="content ">
        <!-- Main content -->
        <div class="container-fluid">

            <div class="panel panel-default">
                <div class="panel-body ">   
                    <!--表单数据-->
                    <form method="post" id="handle_shop">

                        <!--通用信息-->
                    <div class="tab-content col-md-10">                 	  
                        <div class="tab-pane active" id="tab_tongyong">                           
                            <table class="table table-bordered">
                                <tbody>

                                <tr>
                                    <td class="col-sm-2"><span style="color:#F00;">*</span>优惠券名称：</td>
                                    <td class="col-sm-8">
                                        <input type="text" class="form-control" name="couponName" placeholder="请输入优惠券名称" value="{$coupon.couponName}">
                                    </td>
                                </tr>

                                <tr>
                                    <td class="col-sm-2"><span style="color:#F00;">*</span>优惠券金额：</td>
                                    <td class="col-sm-8">
                                        <input type="text" class="form-control input-sm" name="couponAmount" value="{$coupon.couponAmount}" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" >
                                    </td>
                                </tr>

                                <tr>
                                    <td class="col-sm-2"><span style="color:#F00;">*</span>使用条件：</td>
                                    <td class="col-sm-8">
                                        <div class="input-group">
                                            <span class="input-group-addon">满</span>
                                            <input type="text" class="form-control input-sm" name="useCondition" value="{$coupon.useCondition}" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" >
                                            <span class="input-group-addon">元可使用</span>
                                        </div>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="col-sm-2"><span style="color:#F00;">*</span>有效期：</td>
                                    <td class="col-sm-8">
                                        <div class="input-group">
                                            <input type="number" class="form-control input-sm" name="validTime" value="{$coupon.validTime}" >
                                            <span class="input-group-addon">天</span>
                                        </div>
                                        <span style="color:#F00;">输入为0则代表该优惠券任何时候都可使用，直到使用为止</span>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="col-sm-2"><span style="color:#F00;">*</span>使用场景：</td>
                                    <td class="col-sm-8">
                                        <select class="form-control" name="couponType">
                                            <option value="">==请选择使用场景==</option>

                                            <volist name="couponType" id="couponType" key="key">
                                                <option value="{$key-1}" <if condition="($key-1) == $coupon.couponType">selected="selected"</if>  >{$couponType}</option>
                                            </volist>

                                        </select>
                                    </td>
                                </tr>

                                <tr>
                                    <td>规则说明:</td>
                                    <td class="col-sm-8">
                                        <textarea class="form-control" rows="10" cols="60" name="useRule">{$coupon.useRule}</textarea>
                                    </td>
                                </tr>


                                </tbody> 
                                <tfoot>
                                	<tr>
                                        <td>
                                            <input type="hidden" name="couponId" value="{$coupon.couponId}">
                                        </td>
                                	    <td class="text-right"><input class="btn btn-primary" type="button" onclick="shop_submit()" value="保存"></td>
                                    </tr>
                                </tfoot>                               
                            </table>
                        </div>                           
                    </div>              
			    	</form><!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>
<script>
function shop_submit(){
    ajax_form_submit("handle_shop", "{:url('market/doEdit')}");
}
</script>
 </body>
 </html>